\doxysection{C\+:/\+Users/\+ASUS/\+Desktop/dm-\/ctrl\+H7-\/balance-\/9025test/modules/algorithm/controller.c File Reference}
\hypertarget{controller_8c}{}\label{controller_8c}\index{C:/Users/ASUS/Desktop/dm-\/ctrlH7-\/balance-\/9025test/modules/algorithm/controller.c@{C:/Users/ASUS/Desktop/dm-\/ctrlH7-\/balance-\/9025test/modules/algorithm/controller.c}}


PID控制器定义  


{\ttfamily \#include "{}controller.\+h"{}}\newline
{\ttfamily \#include "{}memory.\+h"{}}\newline
\doxysubsubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
void \mbox{\hyperlink{controller_8c_a2f151ba2f498df613fea5f497aeac704}{PIDInit}} (\mbox{\hyperlink{struct_p_i_d_instance}{PIDInstance}} \texorpdfstring{$\ast$}{*}pid, \mbox{\hyperlink{struct_p_i_d___init___config__s}{PID\+\_\+\+Init\+\_\+\+Config\+\_\+s}} \texorpdfstring{$\ast$}{*}config)
\begin{DoxyCompactList}\small\item\em 初始化\+PID,设置参数和启用的优化环节,将其他数据置零 \end{DoxyCompactList}\item 
float \mbox{\hyperlink{controller_8c_ac10c96e3f3e94b80d6df66c2c3ac53d0}{PIDCalculate}} (\mbox{\hyperlink{struct_p_i_d_instance}{PIDInstance}} \texorpdfstring{$\ast$}{*}pid, float measure, float ref)
\begin{DoxyCompactList}\small\item\em PID计算 \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
PID控制器定义 

\begin{DoxyAuthor}{Author}
wanghongxi 

modified by neozng 
\end{DoxyAuthor}
\begin{DoxyVersion}{Version}
beta 
\end{DoxyVersion}
\begin{DoxyDate}{Date}
2022-\/11-\/01
\end{DoxyDate}
@copyright\+Copyright (c) 2022 HNU Yue\+Lu EC all rights reserved 

\label{doc-func-members}
\Hypertarget{controller_8c_doc-func-members}
\doxysubsection{Function Documentation}
\Hypertarget{controller_8c_ac10c96e3f3e94b80d6df66c2c3ac53d0}\index{controller.c@{controller.c}!PIDCalculate@{PIDCalculate}}
\index{PIDCalculate@{PIDCalculate}!controller.c@{controller.c}}
\doxysubsubsection{\texorpdfstring{PIDCalculate()}{PIDCalculate()}}
{\footnotesize\ttfamily \label{controller_8c_ac10c96e3f3e94b80d6df66c2c3ac53d0} 
float PIDCalculate (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{struct_p_i_d_instance}{PIDInstance}} \texorpdfstring{$\ast$}{*}}]{pid}{, }\item[{float}]{measure}{, }\item[{float}]{ref}{}\end{DoxyParamCaption})}



PID计算 

计算\+PID输出


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{in}}  & {\em PID结构体} & \\
\hline
\mbox{\texttt{in}}  & {\em 测量值} & \\
\hline
\mbox{\texttt{in}}  & {\em 期望值} & \\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em 返回空} & \\
\hline
\end{DoxyRetVals}
\Hypertarget{controller_8c_a2f151ba2f498df613fea5f497aeac704}\index{controller.c@{controller.c}!PIDInit@{PIDInit}}
\index{PIDInit@{PIDInit}!controller.c@{controller.c}}
\doxysubsubsection{\texorpdfstring{PIDInit()}{PIDInit()}}
{\footnotesize\ttfamily \label{controller_8c_a2f151ba2f498df613fea5f497aeac704} 
void PIDInit (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{struct_p_i_d_instance}{PIDInstance}} \texorpdfstring{$\ast$}{*}}]{pid}{, }\item[{\mbox{\hyperlink{struct_p_i_d___init___config__s}{PID\+\_\+\+Init\+\_\+\+Config\+\_\+s}} \texorpdfstring{$\ast$}{*}}]{config}{}\end{DoxyParamCaption})}



初始化\+PID,设置参数和启用的优化环节,将其他数据置零 

初始化\+PID实例


\begin{DoxyParams}{Parameters}
{\em pid} & PID实例 \\
\hline
{\em config} & PID初始化设置 \\
\hline
\end{DoxyParams}
